﻿@{
    Layout = null;
}

<form id="addForm" method="post">
<table class="grid" width="100%" cellspacing="0" cellpadding="0">
	<!--基本信息-->
	<tbody>
    <tr>
		<td colspan="6" style="text-align: center; " bgcolor="#dfdfdf" align="center">客户信息</td>
	</tr>
    <tr>
        <td>企业名称</td>
        <td colspan="5">
            <select id="CustomerID" class="easyui-combogrid" name="CustomerID" style="width:300px;"   
                data-options="    
                    delay:500,    
                    mode:'remote',
                    url: '@Url.Content("~/system/GetCustomers")',    
                    idField:'ID',    
                    textField:'TheName',
                    required: true,
                    columns:[[    
                        {field:'TheName',title:'企业名称'},    
                        {field:'Contact',title:'联系人'},    
                        {field:'Phone',title:'联系电话'},    
                        {field:'Addr',title:'企业地址'}    
                    ]]
                "></select>
        </td>
    </tr>

	<tr>
		<td colspan="6" style="text-align: center; " bgcolor="#dfdfdf" align="center">业务信息</td>
	</tr>
	<tr>
        <td>编号</td>
        <td>
		    <input type="text" id="BusinessCode" name="BusinessCode" class="easyui-textbox">
		</td>
		<td>项目名称</td>
		<td colspan="3">
		    <input id="BusinessType1" name="BusinessType1" class="easyui-combobox" data-options="    
				valueField: 'ID',    
				textField: 'TypeName',
				url: '@Url.Content("~/Main/GetParentType")', 
				onLoadSuccess: function(rec){
					if(rec){
						$(this).combobox('setValue',rec[0].ID);
					}
				},
				onSelect: function(rec){
					var url = '@Url.Content("~/Main/GetChildType?id=")'+rec.ID;
					$('#BusinessType2').combobox('clear');
					$('#BusinessType2').combobox('reload', url);
				}" />   
			<input id="BusinessType2" name="BusinessType2" class="easyui-combobox" data-options="
				valueField:'ID',
				textField:'TypeName',
				onLoadSuccess: function(rec){
					if(rec.length>0){
						$(this).combobox('setValue',rec[0].ID);
					}
				}"/>
		</td>
    <tr>
        <td>合同开始日期</td>
        <td>
            <input id="BeginDate" name="BeginDate" type="text" class="easyui-datebox"></input>
        </td>
        <td>合同终止日期</td>
        <td>
            <input id="EndDate" name="EndDate" type="text" class="easyui-datebox"></input>
        </td>
        <td>是否新签</td>
        <td>
            <select id="Contract" class="easyui-combobox" name="Contract">
                <option value="0">----</option> 
                <option value="1">新签</option>
                <option value="2">续签</option>
            </select>
        </td>
    </tr>
	<tr>
		<td>合同金额</td>
		<td>
		    <input type="text" id="Charges" name="Charges"  class="easyui-numberbox" data-options="required:true,min:0,precision:2"/>
		</td>
	    <td>客户介绍人</td>
		<td>
		    <input type="text" name="Introducer" id="Introducer" class="easyui-textbox"/>
		</td>
		<td>经办人</td>
		<td>
		    <input type="text" name="Agent" id="Agent" class="easyui-textbox" data-options="required:true"/>
		</td>
	</tr>
    <tr>
	    <td>所属部（室）</td>
		<td>
		    <input id="TheOffice" name="TheOffice" class="easyui-combobox" data-options="    
				valueField: 'ID',    
				textField: 'Name',
				url: '@Url.Content("~/Main/GetOffice")', 
				onLoadSuccess: function(rec){
                    var officeid = @Session["OfficeID"].ToString();
					if(rec.length>0 && officeid>'0'){
						$('#TheOffice').combobox('setValue',officeid);
					}
				}" />   
		</td>
		<td>所属分局</td>
		<td>
		    <input id="TheDepartment" name="TheDepartment" class="easyui-combobox" data-options="    
				valueField: 'ID',    
				textField: 'Name',
				url: '@Url.Content("~/Main/GetDepartments")', 
				onLoadSuccess: function(rec){
					if(rec.length>0){
						$('#TheDepartment').combobox('setValue',rec[0].ID);
					}
				}" />   
		</td>
		<td>类型</td>
		<td><input id="Payment" name="Payment" class="easyui-combobox" data-options="    
				valueField: 'ID',    
				textField: 'Payment',
				url: '@Url.Content("~/Main/GetPayment")', 
				onLoadSuccess: function(rec){
					if(rec.length>0){
						$('#Payment').combobox('setValue',rec[0].ID);
					}
				}" />
        </td>
	</tr>
	<tr>
	  <td>备注</td>
	  <td colspan="5"><input type="text" name="Items" id="Items" class="easyui-textbox" data-options="multiline:true" style="height:80px;width:600px" /></td>
	</tr>
  </tbody>
</table>
</form>
